<?php
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition End User License Agreement
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magento.com/license/enterprise-edition
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     rwd_enterprise
 * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
 * @license http://www.magento.com/license/enterprise-edition
 */
?>
<?php /** @var $this Enterprise_Rma_Block_Return_Tracking_Package */ ?>
<?php  $_results = $this->getPackageInfo() ?>
<div class="page-title title-buttons">
    <h1><?php echo $this->__('Packages'); ?></h1>
    <button class="button" type="button" title="<?php echo $this->quoteEscape($this->__('Print')) ?>" onclick="setLocation('<?php echo $this->getPrintPackageUrl() ?>');return false;"><span><span><?php echo $this->__('Print') ?></span></span></button>
    <button class="button" type="button" title="<?php echo $this->quoteEscape($this->__('Close Window')) ?>" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
</div>
<div class="packed-content">
<?php foreach ($this->getPackages() as $packageId => $package): ?>
    <div class="package">
        <?php $package = new Varien_Object($package) ?>
        <?php $params = new Varien_Object($package->getParams()) ?>
        <h4><?php echo Mage::helper('sales')->__('Package') . ' ' . $packageId ?></h4>
        <div class="package-info">
            <table class="tracking-table-popup data-table">
                <colgroup>
                    <col width="40%" />
                    <col width="*" />
                    <col width="40%" />
                    <col width="*" />
                </colgroup>
                <tbody>
                    <tr>
                        <th class="label"><?php echo Mage::helper('enterprise_rma')->__('Type') ?></th>
                        <td class="value"><?php echo $this->getContainerTypeByCode($params->getContainer()) ?></td>
                        <th class="label"><?php echo Mage::helper('enterprise_rma')->__('Length') ?></th>
                        <td class="value"><?php echo $params->getLength() .' '. Mage::helper('usa')->getMeasureDimensionName($params->getDimensionUnits()) ?></td>
                    </tr>
                    <tr>
                        <th class="label"><?php echo Mage::helper('enterprise_rma')->__('Total Weight') ?></th>
                        <td class="value"><?php echo $params->getWeight() .' '. Mage::helper('usa')->getMeasureWeightName($params->getWeightUnits()) ?></td>
                        <th class="label"><?php echo Mage::helper('enterprise_rma')->__('Width') ?></th>
                        <td class="value"><?php echo $params->getWidth() .' '. Mage::helper('usa')->getMeasureDimensionName($params->getDimensionUnits()) ?></td>
                    </tr>
                    <tr>
                        <th>&nbsp;</th>
                        <td>&nbsp;</td>
                        <th class="label"><?php echo Mage::helper('enterprise_rma')->__('Height') ?></th>
                        <td class="value"><?php echo $params->getHeight() .' '. Mage::helper('usa')->getMeasureDimensionName($params->getDimensionUnits()) ?></td>
                    </tr>
                </tbody>
            </table>
        </div>
        <strong><?php echo Mage::helper('enterprise_rma')->__('Items in the Package') ?></strong>
        <div class="grid">
            <div class="hor-scroll">
                <table class="tracking-table-popup data-table">
                    <colgroup>
                        <col>
                        <col>
                        <col width="100">
                        <col width="*">
                    </colgroup>
                    <thead>
                    <tr class="headings">
                        <th  class="a-center"><?php echo Mage::helper('enterprise_rma')->__('Product') ?></th>
                        <th  class="a-center"><?php echo Mage::helper('enterprise_rma')->__('Weight') ?></th>
                        <th  class="a-center"><?php echo Mage::helper('enterprise_rma')->__('Qty') ?></th>
                    </tr>
                    </thead>

                    <tbody id="">
                    <?php foreach($package->getItems() as $itemId => $item) : ?>
                        <?php $item = new Varien_Object($item) ?>
                        <tr title="#" id="" class="">
                            <td class="name label">
                                <?php echo $item->getName(); ?>
                            </td>
                            <td class="a-center value">
                                <?php echo $item->getWeight(); ?>
                            </td>
                            <td class="a-right value last">
                                <?php echo $item->getQty()*1; ?>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
<?php endforeach; ?>
</div>
<div class="buttons-set">
    <button class="button" type="button" title="<?php echo $this->quoteEscape($this->__('Close Window')) ?>" onclick="window.close(); window.opener.focus();"><span><span><?php echo $this->__('Close Window') ?></span></span></button>
    <button class="button" type="button" title="<?php echo $this->quoteEscape($this->__('Print')) ?>" onclick="setLocation('<?php echo $this->getPrintPackageUrl() ?>');return false;"><span><span><?php echo $this->__('Print') ?></span></span></button>
</div>
